package com.hzcc.hzccblog.common.enums;

import com.hzcc.hzccblog.common.Result;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author 早睡蛋
 * @Date 2022/6/8 10:50:50
 * @Desc:
 */
@Getter
@AllArgsConstructor
public enum ArticleEnums {

    IDCREATE(200,"编号已生成"),
    isADD(200,"添加成功"),
    noADD(400, "添加失败"),
    NULLID(401,"id丢失，请重试"),
    OK(200,"成功"),
    FAIL(400,"失败"),

    ;

    ArticleEnums(int code, String message) {
        this.result =  Result.defaultResultResponse();
        result.setCode(code);
        result.setMessage(message);
    }

    public int getCode(){
        return result.getCode();
    }

    public String getMessage(){
        return result.getMessage();
    }

    public Result getResult() {
        return result;
    }


    private final Result result;

}
